<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body onload="ymd()">
    <!-- 
    <form >
        <label for="">用户名</label>
        <input type="text" id="userName" name="userName" value="123">
        <input type="radio" name='xb' value="1"> 男
        <input type="radio" name='xb' value="2"> 女
        <input type="button" id="btn" value='btn' onclick="show1()">
    </form> 
    <script>
            function show1() {
            //   alert("123")
            document.getElementById('userName').value = '9999'
            }
            let xb = document.getElementsByName('xb')
    </script>
    -->
    <select name="yyy" id="yyy">
        
    </select>
    
    <script>
    function ymd() {
        let date = new Date();
        let year = parseInt(date.getFullYear())
        let yyy = document.getElementById("yyy");
        console.log(yyy)
        for(let i=1999;i<=year;i++) {
            yyy.options.add(new Option(i,i))
        }
    }
    </script>
</body>
</html>